package com.xpc.test.queryobj;

import cn.hutool.core.text.CharSequenceUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xpc.test.base.QueryObject;
import com.xpc.test.bean.FileInfo;
import lombok.Data;

/**
 * 功能描述：查询对象
 *
 * @author xpc on 2024/4/3 14:06
 */
@Data
public class FileInfoQueryObj extends QueryObject<FileInfo> {

    private String fileName;

    private String fileOrgName;

    private String fileType;

    @Override
    protected void buildQuery(QueryWrapper<FileInfo> queryWrapper) {
        queryWrapper.lambda()
                .like(CharSequenceUtil.isNotEmpty(fileName), FileInfo::getFileName, fileName)
                .like(CharSequenceUtil.isNotEmpty(fileOrgName), FileInfo::getFileOrgName, fileOrgName)
                .like(CharSequenceUtil.isNotEmpty(fileType), FileInfo::getFileType, fileType);
    }
}
